//布尔二叉树--递归练习

class Solution {
public:
    bool evaluateTree(TreeNode* root) {
        if(root->val == 1) return true;
        if(root->val == 0) return false;
        int ret1 = evaluateTree(root->left);
        int ret2 = evaluateTree(root->right);
        if(root->val == 2) return ret1 || ret2;
        else return ret1 && ret2;
    }
};